package com.globallogic.jaxrs;

import java.io.Writer;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;

public class RsMarshaller {

    public static void marshal(Object element, Writer writer) {

        try {

            JAXBContext context = JAXBContext.newInstance(element.getClass());
            Marshaller marshaller = context.createMarshaller();

            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
            marshaller.marshal(element, writer);

        } catch (JAXBException e) {
//            logger.error(e.getMessage(), e);
        }

    }
	
}
